import 'package:flutter/material.dart';
import 'package:haokezufang/widgets/common_image.dart';

import 'index_navigator_item.dart';

class IndexNavigator extends StatelessWidget {
  const IndexNavigator({super.key});

  @override
  Widget build(BuildContext context) {
    return Row(
        mainAxisAlignment: MainAxisAlignment.spaceAround,
        children: navigatorList
            .map((item) => InkWell(
                  onTap: () {
                    item.onTap(context);
                  },
                  child: Column(
                    children: [
                      CommonImage(
                        src: item.imageUrl,
                        width: 50,
                        height: 50,
                        fit: BoxFit.fill,
                      ),
                      Text(
                        item.title,
                        style: const TextStyle(
                            fontSize: 14, fontWeight: FontWeight.bold),
                      )
                    ],
                  ),
                ))
            .toList());
  }
}
